#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<assert.h>
#include"mijson.h"

typedef struct{
    const char* json;
} mi_context;

static void parse_whitespace(mi_value* v, mi_context* c){
    const char* p = c->json;
    while(p == ' ' || p == '\t' || p == '\n' || p == '\r')
        p++;
    c->json = p;
}

/* Parse "true", "false", "null"*/
static int parse_literal(mi_value* v, mi_context* c, const char* p, mi_type type){
    const char* json = c->json;
    while(*p != '\0'){
        if(*json != *p)
            return MI_PARSE_INVALID_VALUE;
        json++;
        p++;
    }

    c->json = json;
    v->type = type;
    return MI_PARSE_OK;
}

int mi_parse(mi_value *v, const char* json){
    mi_context c;
    assert(v != NULL);
    c.json = json;
    parse_whitespace(v, &c);
    
}